package qshell

import (
	"bufio"
	"fmt"
	"os"
)

func (s *Shell) Out() {
	fmt.Printf(s.now.out)
	s.history = append(s.history, s.now)
}

// ListenInput 监听输入
func (s *Shell) ListenInput() {
	for {
		res, _, err := bufio.NewReader(os.Stdin).ReadLine()
		if err != nil {
			continue
		}
		re := &Record{
			index:    1,
			input:    string(res),
			clientip: "127.0.0.1",
			serverip: "127.0.0.1",
		}
		s.inputChan <- re
	}

}
